﻿using Lcygcc.Infrastructure.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Lcygcc.Domain.Common
{
    /// <summary>
    /// 公共帮助类
    /// </summary>
    public static class CommonHelper
    {
        public static DicDetail GetDicDetailInfo(string dicTypeEnName, string dicEnDetailName)
        {
            DicDetail detail = null;
            var list = EnvironmentInfo.DictionaryInfoList;
            if (list != null)
            {
                var dictInfo = list.FirstOrDefault(it => it.dicType.DicTypeEnName == dicTypeEnName);
                if (dictInfo != null)
                {
                    if (dictInfo.dicType != null)
                    {
                        detail = dictInfo.dicDetailList.FirstOrDefault(it => it.DicEnDetailName == dicEnDetailName && it.DicTypeId == dictInfo.dicType.DicTypeId);
                    }
                }
            }
            return detail;
        }
    }
}
